//
//  HYInfoContentCell.m
//  HaiYue
//
//  Created by skyline on 2018/2/6.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "HYInfoContentCell.h"
#import "HYInfoLabel.h"
@interface HYInfoContentCell()
@property (nonatomic, strong) HYInfoLabel *infoLBL;

@end
@implementation HYInfoContentCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.separatorInset = UIEdgeInsetsMake(0, SCREEN_WIDTH, 0, 0);
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (HYInfoLabel *)infoLBL
{
    if (!_infoLBL)
    {
        _infoLBL = [[HYInfoLabel alloc] init];        
        [self addSubview:_infoLBL];
        [_infoLBL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self);
            make.left.equalTo(self);
            make.right.equalTo(self);
            make.height.mas_equalTo(10);
        }];
    }
    return _infoLBL;
}

- (void)setDict:(NSDictionary *)dict
{
    if (_dict != dict)
    {
        _dict = dict;
        self.infoLBL.html = [_dict valueForKey:@"content"];
        [self updateBounds];
    }
}

- (void)updateBounds
{
    self.bounds = CGRectMake(0, 0, SCREEN_WIDTH, self.infoLBL.bounds.size.height);
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
